$(document).ready(function(){
	eventBind();
	initDatePickers();
	genDictSelect('studyCode','study_type1','1');
});
// 事件绑定
function eventBind(){
	$('#cancel').click(function(){
		BootstrapDialog.closeAll();
	})
	$('#save').on('click',saveApply);
}

//保存申请
function saveApply(){
	if(!$("#showForm").validationForm()){
		return;
	}
	$.getApiClient('/study/showOnline').post('#showForm', function(params){
			return $.extend(params, {
				course_name: $('#course_name1').val(),
				course_time: $('#course_time').val(),
				course_desc:$('#course_desc').val()
			});
		}).done(function(data){
			if(data.code == "0"){
				BootstrapDialog.closeAll();
				customTimeOutDialog('信息提示','保存成功',null,2000);
				pageQuery();
			}else{
				customAlertDialog(data.message, '错误提示', null, null);
			}
		});
}
